package com.ymatou.c2clivebizer.service;

import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;

public class LiveFilterCall  extends YmatouBaseCall{
private static String opurl ="search/livefilter";
	
	public LiveFilterCall() {
		super(EnvSetup.getSystemUrl("livefilter"),opurl,"GET","PARAM");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	/**
	 * 得到接口返回状态结果
	 * @return String OK
	 * */
	public String getStatus() {
		String ok = null;
		try {
			JSONObject jo = new JSONObject(getReturnData());
			ok = jo.getString("status");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return ok;
	}
	
	/**
	 * 获取hits列表
	 * 
	 * @return 
	 */
	public JSONObject getStats() {
		JSONObject Data = null;
		try {
			Data = new JSONObject(getReturnData()).getJSONObject("stats");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Data;
	}
}
